﻿using System;
using System.Collections.Generic;

namespace VisionCloud.Domain.DtoModel.Ms
{
    public class MsSQualityAnalysisCondition
    {
        /// <summary>
        /// 项目Id
        /// </summary>
        public Guid ProjectGuid { get; set; }

        /// <summary>
        /// 公司Id
        /// </summary>
        public Guid CompanyGuid { get; set; }
    }

    public class MsSQualityAnalysisDto
    {
        /// <summary>
        /// 项目综合合格率
        /// </summary>
        public CQRDto CQRData { get; set; } = new CQRDto();

        /// <summary>
        /// 不同阶段测量项合格率
        /// </summary>
        public List<ProjectStandard> MeasureItemData { get; set; } = new List<ProjectStandard>();

        /// <summary>
        /// 楼栋合格率
        /// </summary>
        public List<QualityAnalysisInfo> BuildingData { get; set; } = new List<QualityAnalysisInfo>();

        /// <summary>
        /// 测量项列表
        /// </summary>
        public List<string> MeasureItems { get; set; } = new List<string>();

        /// <summary>
        /// 按任务阶段分楼层合格率
        /// </summary>
        public List<BuildingStandardInfo> Floors { get; set; } = new List<BuildingStandardInfo>();

        /// <summary>
        /// 按任务阶段分户型合格率
        /// </summary>
        public List<BuildingStandardInfo> Houses { get; set; } = new List<BuildingStandardInfo>();

        /// <summary>
        /// 已测站点列表
        /// </summary>
        public List<PointStandardInfo> Points { get; set; } = new List<PointStandardInfo>();
    }

    /// <summary>
    /// 综合合格率--通过两个维度测量和项目阶段分
    /// </summary>
    public class CQRDto
    {
        /// <summary>
        /// 测量阶段：初测和复测
        /// </summary>
        public List<QualityAnalysisInfo> StageData { get; set; }

        /// <summary>
        /// 项目阶段：结构，砌筑，抹灰等
        /// </summary>
        public List<QualityAnalysisInfo> StandardData { get; set; }
    }

    public class QualityAnalysisInfo
    {
        /// <summary>
        /// 名称：初测或复测；项目阶段：结构，砌筑，抹灰，或栋
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 总测点数
        /// </summary>
        public int TotalPoints { get; set; }

        /// <summary>
        /// 合格点数
        /// </summary>
        public int PassPoints { get; set; }

        /// <summary>
        /// 爆点数
        /// </summary>
        public int FailPoints { get; set; }

        /// <summary>
        /// 合格率%
        /// </summary>
        public string Pass { get; set; }

        /// <summary>
        /// 冗余字段：楼层
        /// </summary>
        public string Floor { get; set; }

        /// <summary>
        /// 冗余字段：楼栋号
        /// </summary>
        public string Building { get; set; }
    }

    public class ProjectStandard
    {
        /// <summary>
        /// 阶段名称
        /// </summary>
        public string Title { get; set; }

        public List<MeasureItemInfo> MeasureItem { get; set; } = new List<MeasureItemInfo>();
    }

    /// <summary>
    /// 楼栋测量信息
    /// </summary>
    public class BuildingInfos
    {
        /// <summary>
        /// 阶段名称
        /// </summary>
        public string Title { get; set; }

        public List<MeasureItemInfo> MeasureItem { get; set; } = new List<MeasureItemInfo>();
    }

    /// <summary>
    /// 楼层测量信息
    /// </summary>
    public class FloorInfo
    {
        /// <summary>
        /// 楼层名称
        /// </summary>
        public string Title { get; set; }

        public List<QualityAnalysisInfo> MeasureIfoInfos { get; set; } = new List<QualityAnalysisInfo>();
    }

    /// <summary>
    /// 测量项合格率
    /// </summary>
    public class MeasureItemInfo
    {
        /// <summary>
        /// 测量项名称
        /// </summary>
        public string Title { get; set; }

        public List<QualityAnalysisInfo> Data { get; set; } = new List<QualityAnalysisInfo>();
    }

    /// <summary>
    /// 测量项合格率
    /// </summary>
    public class BuildingMeasureItemInfo
    {
        /// <summary>
        /// 测量项名称
        /// </summary>
        public string Title { get; set; }

        public List<QualityAnalysisInfo> Data { get; set; } = new List<QualityAnalysisInfo>();

        /// <summary>
        /// 对应测量项是否存在数据标记
        /// </summary>
        public bool HasData { get; set; }
    }

    /// <summary>
    /// 楼层合格率按阶段分
    /// </summary>
    public class BuildingStandardInfo
    {
        /// <summary>
        /// 阶段名称
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 按阶段分，各个测量项合格率
        /// </summary>
        public List<BuildingMeasureItemInfo> Data { get; set; } = new List<BuildingMeasureItemInfo>();
    }

    /// <summary>
    /// 站点合格率按阶段分
    /// </summary>
    public class PointStandardInfo
    {
        /// <summary>
        /// 阶段名称
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 按阶段分，各个测量项合格率
        /// </summary>
        public List<BuildingMeasureItemInfo> Data { get; set; } = new List<BuildingMeasureItemInfo>();
    }

    /// <summary>
    /// 质量分析明细查询Dto
    /// </summary>
    public class QualityAnalysisDetailDto
    {
        /// <summary>
        /// 项目Id
        /// </summary>
        public string ProjectId { get; set; }

        /// <summary>
        /// 楼层Id
        /// </summary>
        public string Build { get; set; }

        public string Category { get; set; }
    }
}